﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using MenuPlanner.Models;
using MenuPlanner.Utilities;

namespace MenuPlanner.Controllers
{
  [Language]
  public class HomeController : Controller
  {
    private RestaurantEntities db = new RestaurantEntities();

    //
    // GET: /Menu/

    public ActionResult Index()
    {
      var menus = db.Menus.Where(m => m.Active).OrderBy(m => m.Order).Include("MenuCard");
      return View(menus.ToList());
    }

    protected override void Dispose(bool disposing)
    {
      db.Dispose();
      base.Dispose(disposing);
    }
  }
}